<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>


<script>
  /*
   定义字符串
   */
  var str = "abc";
  var str1 = new String("abc");

  console.log(str.length);
  console.log(str.charAt(0));

  var str2 = " abc ";
  console.log("1"+str2+"1");

  //trim() 方法 是  去除两端空格
    var s = str2.trim();

    console.log("1"+s+"1");



</script>
</body>
</html>